package edu.cmu.cs.stage3.alice.authoringtool.datatransfer;

import edu.cmu.cs.stage3.alice.authoringtool.AuthoringTool;

/**
 * @author Jason Pratt
 */
public class TransferableFactory {

 public static java.awt.datatransfer.Transferable createTransferable (Object object) {
  if (object instanceof edu.cmu.cs.stage3.alice.core.Element) {
   // edu.cmu.cs.stage3.alice.authoringtool.viewcontroller.VariableDnDPanel.set(AuthoringTool,edu.cmu.cs.stage3.alice.core.Variable): setTransferable(TransferableFactory.createTransferable(variable))
   return new ElementReferenceTransferable( (edu.cmu.cs.stage3.alice.core.Element)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedResponsePrototype) {
   return new CallToUserDefinedResponsePrototypeReferenceTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedResponsePrototype)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype) {
   return new CallToUserDefinedQuestionPrototypeReferenceTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.CallToUserDefinedQuestionPrototype)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.ResponsePrototype) {
   return new ResponsePrototypeReferenceTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.ResponsePrototype)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.QuestionPrototype) {
   return new QuestionPrototypeReferenceTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.QuestionPrototype)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.ElementPrototype) {
   return new ElementPrototypeReferenceTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.ElementPrototype)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.authoringtool.util.ObjectArrayPropertyItem) {
   return new ObjectArrayPropertyItemTransferable( (edu.cmu.cs.stage3.alice.authoringtool.util.ObjectArrayPropertyItem)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.core.Property) {
   return new PropertyReferenceTransferable( (edu.cmu.cs.stage3.alice.core.Property)object );
  } else if (object instanceof edu.cmu.cs.stage3.alice.core.CopyFactory) {
   return new CopyFactoryTransferable( (edu.cmu.cs.stage3.alice.core.CopyFactory)object );
  } else {
   System.err.println("Error: TransferableFactory.java: cannot create Transferable for: " + object);
   AuthoringTool.getInstance().showErrorDialog( "cannot create Transferable for: " + object, null );
   return null;
   }
  }

 }
